home *** CD-ROM | disk | FTP | other *** search
/ Freelog Special Edition 10 / FreelogHS10.iso / Buzz / Buzz_Advanced_Pack.exe / {app} / Dev / dsplib / dsplib.h < prev    next >
C/C++ Source or Header  |  2001-08-27  |  3KB  |  95 lines

  1. #ifndef __BUZZ_DSPLIB_H
  2. #define __BUZZ_DSPLIB_H
  3.  
  4. /*
  5.  
  6.     How to use dsplib in Buzz machines:
  7.  
  8.         Add dsplib.lib to library modules list of your project and #include 
  9.         this file. After that you can simply call the functions you need.
  10.  
  11.         Note: Some of these functions may not be implemented yet. You will 
  12.         get a link error if you try to use them.
  13.   
  14.     Descriptions for the abbrvs. used in this file:
  15.   
  16.         ps - pointer to samples
  17.         pin - pointer to input samples
  18.         pout - pointer to output samples
  19.         n - number of samples 
  20.         a - amplitude scaling factor
  21.         la - left a
  22.         ra - right a
  23.         M - mono 
  24.         2 - to
  25.         S - stereo
  26.  
  27.  
  28.  
  29. */
  30.  
  31. typedef unsigned long dword;
  32.  
  33. #define DI __declspec(dllimport)
  34.  
  35. // initialization
  36.  
  37. // you don't need to call DSP_Init in machines 
  38. // buzz uses the same dll so it has done it already 
  39. DI void DSP_Init(int const samplerate);    
  40.  
  41. // basic stuff
  42.  
  43. DI void DSP_Zero(float *ps, dword const n);
  44.     
  45. DI void DSP_Copy(float *pout, float const *pin, dword const n);
  46. DI void DSP_Copy(float *pout, float const *pin, dword const n, float const a);
  47.  
  48. DI void DSP_CopyM2S(float *pout, float const *pin, dword const n);
  49. DI void DSP_CopyM2S(float *pout, float const *pin, dword const n, float const a);
  50. DI void DSP_CopyM2S(float *pout, float const *pin, dword const n, float const la, float const ra); 
  51.  
  52. DI void DSP_CopyS2MOneChannel(float *pout, float const *pin, dword const n, float const a);
  53.  
  54. DI void DSP_Add(float *pout, float const *pin, dword const n);
  55. DI void DSP_Add(float *pout, float const *pin, dword const n, float const a);
  56.  
  57. DI void DSP_AddM2S(float *pout, float const *pin, dword const n);
  58. DI void DSP_AddM2S(float *pout, float const *pin, dword const n, float const a);
  59. DI void DSP_AddM2S(float *pout, float const *pin, dword const n, float const la, float const ra); 
  60.  
  61. DI void DSP_AddS2S(float *pout, float const *pin, dword const n);
  62. DI void DSP_AddS2S(float *pout, float const *pin, dword const n, float const a);
  63. DI void DSP_AddS2S(float *pout, float const *pin, dword const n, float const la, float const ra); 
  64.  
  65. DI void DSP_AddS2MOneChannel(float *pout, float const *pin, dword const n, float const a);
  66. DI void DSP_AddS2SOneChannel(float *pout, float const *pin, dword const n, float const a);
  67.  
  68. DI void DSP_Amp(float *ps, dword const n, float const a);
  69.  
  70. // second order butterworth filters
  71.  
  72. #include "bw.h"
  73.  
  74. DI void DSP_BW_Reset(CBWState &s);    // clears past inputs & outputs 
  75.  
  76. DI void DSP_BW_InitLowpass(CBWState &s, float const f);
  77. DI void DSP_BW_InitHighpass(CBWState &s, float const f);
  78. DI void DSP_BW_InitBandpass(CBWState &s, float const f, float const bw);
  79. DI void DSP_BW_InitBandreject(CBWState &s, float const f, float const bw);
  80.  
  81. DI bool DSP_BW_Work(CBWState &s, float *ps, dword const n, int const mode);
  82. DI bool DSP_BW_WorkStereo(CBWState &s, float *ps, dword const n, int const mode);
  83.  
  84. // resampler
  85.  
  86. #include "resample.h"
  87.  
  88. DI void DSP_Resample(float *pout, int numsamples, CResamplerState &state, CResamplerParams const ¶ms);
  89.          
  90.  
  91. #undef DI
  92.  
  93.  
  94.  
  95. #endif